<!--
 @description 新增业务变更
 @fileName Add.vue
 @author zengqiongying
 @created 2023-04-26 19:03:10
-->
<template>
  <DealerChoice @confirm="onCreat" />
</template>

<script lang="ts">
  import { useRouter, useRoute } from 'vue-router'
  import DealerChoice from '../dealerChoice/index.vue'
  import { createCustomerChange } from '../mixins/Create'
  export default {
    name: 'DealerShopChangeAdd',
    components: { DealerChoice },
    setup() {
      const $router = useRouter()
      const $route = useRoute()
      const pageType = `${$route.query?.type || 'C'}`
      $route.meta.title = pageType === 'C' ? '新增业务' : '取消业务变更'
      const onCreat = (businessData: any) => {
        createCustomerChange(businessData, pageType, (id: string) => {
          $router.replace({
            path: '/dealerShopChange/edit',
            query: {
              id
            }
          })
        })
      }
      return {
        onCreat
      }
    }
  }
</script>
<style lang="less" scoped></style>
